package com.shixi.shixitraining.shixitraining.ui.tabhome.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.RequestManager;
import com.shixi.shixitraining.shixitraining.R;
import com.shixi.shixitraining.shixitraining.ui.tabhome.entity.HomeGrideBean;
import com.shixi.shixitraining.shixitraining.view.recycleview.BaseAdapter;
import com.shixi.shixitraining.shixitraining.view.recycleview.BaseRecycleHolder;

import java.util.List;

/**
 * Created by shenyan on 2018/7/9.
 */

public class HomeGrideAdapter extends BaseAdapter<HomeGrideBean> {

    private RequestManager manager;
    public HomeGrideAdapter(Context context, List<HomeGrideBean> data, RequestManager manager) {
        super(context, data);
        this.manager=manager;
    }

    @Override
    public void convert(BaseRecycleHolder holder, HomeGrideBean item, int position) {
        holder.setText(R.id.item_gride_item_name, item.getTitle());
        ImageView imageView = holder.getView(R.id.item_gride_item_img);
        imageView.setImageResource(item.getUrl());
    }

    @Override
    protected int getLayoutId(int viewType) {
        return R.layout.adapter_home_gride;
    }



}
